package com.kaifamiao.strings;

import java.nio.charset.Charset;
import java.util.Arrays;

public class StringTest4 {

	// --add-opens java.base/java.lang=ALL-UNNAMED
	public static void main(String[] args) {
		
		final String s = "abcdefABCDEF123456" ;
		System.out.println( s );
		StringHelper.show( s );
		
		StringHelper.set( s , 0 , (byte)65 );
		System.out.println( s );
		
		StringHelper.set( s , 1 , (byte)66 );
		System.out.println( s );
		
		StringHelper.set( s , 2 , (byte)48 );
		System.out.println( s );
		
		String x = "人之初" ;
		StringHelper.show( x );
		
		System.out.println( Arrays.toString( x.getBytes( Charset.forName( "GBK" ) ) ));
		System.out.println( Arrays.toString( x.getBytes( Charset.forName( "UTF-16" ) ) ));
		System.out.println( Arrays.toString( x.getBytes( Charset.forName( "UTF-16BE" ) ) ));
		System.out.println( Arrays.toString( x.getBytes( Charset.forName( "UTF-16LE" ) ) ));
		
	}

}
